package top.yaofengqiao.springcloudsimple.auth.biz.domain.auth.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yfq
 * @date 2024/3/26 11:49
 * @description
 */
@Getter
@AllArgsConstructor
public enum UserType {
    ADMIN(0, "管理员"),
    MEMBER(1, "会员"),
    ;

    private final int type;

    private final String desc;

    public static UserType determineUserType(int userType) {
        for (UserType type : UserType.values()) {
            if (type.getType() == userType) return type;
        }

        return null;
    }
}
